package main

import (
	"fmt"
	"reflect"
)

type resume struct {
	Name string `info:"name" doc:"沈自在"`
	Age  int    `test:"aa"`
}

func findTag(str interface{}) {
	t := reflect.TypeOf(str)
	for i := 0; i < t.NumField(); i++ {
		tag := t.Field(i).Tag.Get("info")
		fmt.Printf("tag info is: %s\n", tag)

		tag = t.Field(i).Tag.Get("doc")
		fmt.Printf("tag doc is: %s\n", tag)

		tag = t.Field(i).Tag.Get("test")
		fmt.Printf("tag test is: %s\n", tag)
	}
}

func main() {
	var re resume
	findTag(re)
}
